import request from "@/utils/request";

/** 排班时段表单 */
export interface PeriodForm {
  id?: number;
  startTime?: string;
  endTime?: string;
  timeFlag?: string;
  canReservation?: boolean;
}
/** 排班时段对象 */
export interface PeriodVO {
  canReservation: boolean;
  endTime: string;
  id: number;
  startTime: string;
  timeFlag: string;
}
class periodAPI {
  /** 获取排班时段列表 */
  static getPeriod() {
    return request<any, PeriodVO[]>({
      url: "/api/reservation/time",
      method: "get",
      // data: params,
    });
  }
  /** 新增+修改 排班时段列表 */
  static updatePeriod(params: PeriodForm) {
    return request<any, PeriodVO[]>({
      url: "/api/reservation/time",
      method: "post",
      data: params,
    });
  }
  /** 删除排班时段列表 */
  static deletePeriod(id: string) {
    return request({
      url: `/api/reservation/time/${id}`,
      method: "delete",
      // data: params,
    });
  }
}

export default periodAPI;
